<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div id="app">
    <!-- <p @click="add">{{counter}}</p>
    <p v-a="as">{{counter}}</p> -->
    <!-- <p>{{counter}}</p>
    <p>{{counter}}</p>
    <p>{{number}}</p> -->
    <!-- <p v-text="counter"></p>
    <p v-html="desc"></p>
    <p><input type="text" v-model="desc"></p>
    <p><input type="text" value="changeInput" @input="changeInput"></p> -->
  </div>
</body>
</html>
<script src="./vue2.js"></script>
<script>
  const app = new Vue({
    el: '#app',
    data: {
      counter: 1,
      number:10,
      desc: `<h1 style="color:red">hello CVue</h1>`
    },
    render(h) {
      // const d1 = document.createElement('div')
      // d1.id = 'app'
      // const p1 = document.createElement('p')
      // p1.textContent = this.counter
      // d1.appendChild(p1)
      // return d1
      // vdom
      return h('div', {id: 'app', title: this.counter}, [
        h('p', null, this.counter + '')
      ])
    },
    methods: {
      add() {
        console.log('add',this);
        this.counter++
      },
      changeInput() {
        console.log('changeInput');
      }
    }
  })
  setInterval(() => {
    app.counter++
  }, 1000);
</script>